<div id="syllabus_links">
  {{#if overrides_present}}
    <a id="toggle_special_dates_in_syllabus" class="shown" href="#">
      <span class="hide">{{#t "syllabus.hide_specific_dates"}}Hide section, group, and person specific dates{{/t}}</span>
      <span class="show">{{#t "syllabus.show_specific_dates"}}Show section, group, and person specific dates{{/t}}</span>
    </a>
  {{else}}
    &nbsp;
  {{/if}}
</div>
<table id="syllabus" class="ic-Table ic-Table--condensed">
  <thead>
    <tr>
      <th scope="col" style="width: 25%;">{{#t "headers.date"}}Date{{/t}}</th>
      <th scope="col" style="width: 75%;">
        <div style="float: right;"></div>
        {{#t "headers.details"}}Details{{/t}}
      </th>
    </tr>
  </thead>
  <tbody>
    {{#each dates}}
    <tr class="date{{#if passed}} date_passed{{/if}}{{#if date}} events_{{strftime date "%Y_%m_%d"}}{{/if}}">
      <td scope="row" valign="top" class="day_date" data-date="{{#if date}}{{strftime date "%Y_%m_%d"}}{{/if}}">
        {{#if date}}
          {{tDateToString date "medium_with_weekday"}}
        {{/if}}
      </td>
      <td class="details">
        <table class="detail_list">
          {{#each events}}
          <tr class="syllabus_{{type}} related-{{related_id}}{{#if override}} special_date{{/if}}">
            <td class="name{{#unless last}} not_last{{/unless}}">
              {{#ifEqual type 'assignment'}}
                {{addIcon 'assignment'}}
              {{else}}
                {{addIcon 'calendar-month'}}
              {{/ifEqual}}
              {{#if html_url}}
                <a href="{{html_url}}">{{title}}</a>
              {{else}}
                {{title}}
              {{/if}}
              {{#if override}}
                <div class="special_date_title">({{override.title}})</div>
              {{/if}}
            </td>
            <td class="dates{{#unless last}} not_last{{/unless}}">
              {{#if start_at}}
                {{#if due_at}}
                  {{t "due by"}} <span {{contextSensitiveDatetimeTitle (unfudge due_at)}} >{{tTimeHours due_at}}</span>
                {{else}}
                  <span {{contextSensitiveDatetimeTitle (unfudge start_at)}} >{{tTimeHours start_at}}</span>
                  {{#unless same_time}}
                    {{t "to" }}
                    <span {{contextSensitiveDatetimeTitle (unfudge end_at)}} >
                      {{#if same_day}}
                        {{tTimeHours end_at}}
                      {{else}}
                        {{tEventToString end_at 'short' 'tiny_on_the_hour'}}
                      {{/if}}
                   </span>
                  {{/unless}}
                {{/if}}
              {{else}}
                &nbsp;
              {{/if}}
            </td>
          </tr>
          {{/each}}
        </table>
      </td>
    </tr>
    {{/each}}
  </tbody>
</table>
